import { FC } from 'react'
import { RootState } from '@/store'
import { asyncChangeUserAgeAction } from '@/store/features/counter/counterSlice.ts'
import { useAppDispatch, useAppSelector } from '@/store/hooks.ts'

const Home: FC = () => {
  const count = useAppSelector((state: RootState) => state.counter.value)
  const dispatch = useAppDispatch()
  const handleClick = () => {
    dispatch(asyncChangeUserAgeAction('123123'))
  }
  return (
    <>
      <div>
        current：{count}
        <br />
        Hello World
      </div>
      <button onClick={handleClick}>click</button>
    </>
  )
}

export default Home
